package dp.gr03.payroll.affiliationTransactions;

import dp.gr03.payroll.affiliations.UnionAffiliation;
import dp.gr03.payroll.payrollDatabase.PayrollDatabase;
import dp.gr03.payroll.payrollDomain.Affiliation;
import dp.gr03.payroll.payrollDomain.Employee;

public class ChangeMemberTransaction extends ChangeAffiliationTransaction
{

    private int memberId;
    private double dues;

    public ChangeMemberTransaction(int empId, int memberId, double dues)
    {
        super(empId);
        this.memberId = memberId;
        this.dues = dues;
    }

    @Override
    public Affiliation getAffiliation()
    {
        return new UnionAffiliation(memberId, dues);
    }

    @Override
    public void recordMembership(Employee e)
    {
        PayrollDatabase.getInstance().addUnionMember(memberId, e);
    }
}
